/**
 */
package ConnectorGenerator.impl;

import ConnectorGenerator.CommunicationStyle.CommunicationStyle;

import ConnectorGenerator.ConnectorArchitecture.ConnectorArchitecture;

import ConnectorGenerator.ConnectorDatabase;
import ConnectorGenerator.ConnectorGeneratorPackage;

import ConnectorGenerator.ElementArchitecture.ElementArchitecture;
import ConnectorGenerator.ElementArchitecture.ElementType;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Connector Database</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ConnectorGenerator.impl.ConnectorDatabaseImpl#getCommunicationStyles <em>Communication Styles</em>}</li>
 *   <li>{@link ConnectorGenerator.impl.ConnectorDatabaseImpl#getConnectorArchitectures <em>Connector Architectures</em>}</li>
 *   <li>{@link ConnectorGenerator.impl.ConnectorDatabaseImpl#getElementArchitectures <em>Element Architectures</em>}</li>
 *   <li>{@link ConnectorGenerator.impl.ConnectorDatabaseImpl#getElementTypes <em>Element Types</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ConnectorDatabaseImpl extends ConnectorSpecificationImpl implements ConnectorDatabase {
	/**
	 * The cached value of the '{@link #getCommunicationStyles() <em>Communication Styles</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCommunicationStyles()
	 * @generated
	 * @ordered
	 */
	protected EList<CommunicationStyle> communicationStyles;

	/**
	 * The cached value of the '{@link #getConnectorArchitectures() <em>Connector Architectures</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConnectorArchitectures()
	 * @generated
	 * @ordered
	 */
	protected EList<ConnectorArchitecture> connectorArchitectures;

	/**
	 * The cached value of the '{@link #getElementArchitectures() <em>Element Architectures</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getElementArchitectures()
	 * @generated
	 * @ordered
	 */
	protected EList<ElementArchitecture> elementArchitectures;

	/**
	 * The cached value of the '{@link #getElementTypes() <em>Element Types</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getElementTypes()
	 * @generated
	 * @ordered
	 */
	protected EList<ElementType> elementTypes;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ConnectorDatabaseImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ConnectorGeneratorPackage.Literals.CONNECTOR_DATABASE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<CommunicationStyle> getCommunicationStyles() {
		if (communicationStyles == null) {
			communicationStyles = new EObjectContainmentEList<CommunicationStyle>(CommunicationStyle.class, this, ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES);
		}
		return communicationStyles;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ConnectorArchitecture> getConnectorArchitectures() {
		if (connectorArchitectures == null) {
			connectorArchitectures = new EObjectContainmentEList<ConnectorArchitecture>(ConnectorArchitecture.class, this, ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES);
		}
		return connectorArchitectures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ElementArchitecture> getElementArchitectures() {
		if (elementArchitectures == null) {
			elementArchitectures = new EObjectContainmentEList<ElementArchitecture>(ElementArchitecture.class, this, ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES);
		}
		return elementArchitectures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ElementType> getElementTypes() {
		if (elementTypes == null) {
			elementTypes = new EObjectContainmentEList<ElementType>(ElementType.class, this, ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES);
		}
		return elementTypes;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES:
				return ((InternalEList<?>)getCommunicationStyles()).basicRemove(otherEnd, msgs);
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES:
				return ((InternalEList<?>)getConnectorArchitectures()).basicRemove(otherEnd, msgs);
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES:
				return ((InternalEList<?>)getElementArchitectures()).basicRemove(otherEnd, msgs);
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES:
				return ((InternalEList<?>)getElementTypes()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES:
				return getCommunicationStyles();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES:
				return getConnectorArchitectures();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES:
				return getElementArchitectures();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES:
				return getElementTypes();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES:
				getCommunicationStyles().clear();
				getCommunicationStyles().addAll((Collection<? extends CommunicationStyle>)newValue);
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES:
				getConnectorArchitectures().clear();
				getConnectorArchitectures().addAll((Collection<? extends ConnectorArchitecture>)newValue);
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES:
				getElementArchitectures().clear();
				getElementArchitectures().addAll((Collection<? extends ElementArchitecture>)newValue);
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES:
				getElementTypes().clear();
				getElementTypes().addAll((Collection<? extends ElementType>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES:
				getCommunicationStyles().clear();
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES:
				getConnectorArchitectures().clear();
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES:
				getElementArchitectures().clear();
				return;
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES:
				getElementTypes().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__COMMUNICATION_STYLES:
				return communicationStyles != null && !communicationStyles.isEmpty();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__CONNECTOR_ARCHITECTURES:
				return connectorArchitectures != null && !connectorArchitectures.isEmpty();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_ARCHITECTURES:
				return elementArchitectures != null && !elementArchitectures.isEmpty();
			case ConnectorGeneratorPackage.CONNECTOR_DATABASE__ELEMENT_TYPES:
				return elementTypes != null && !elementTypes.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //ConnectorDatabaseImpl
